const {get_others} = require('../../Class/GetOthers.js');
const getOthers = new get_others();
Page({
  data: {
    cardCur: 0,
  },
  async onLoad() {
    wx.showLoading({
      title:'数据通信中'
    })
    const result = await getOthers.Get_Wencui()
    const navbarHeight = getOthers.Set_navbar()
    this.setData({
      swiperList: [{
        id: 0,
        url: 'https://kanekikeh.online/kechengzhanyan/picture/wanhui2.png'
      }, {
        id: 1,
        url: 'https://kanekikeh.online/kechengzhanyan/picture/%E8%AF%97%E6%AD%8C.png',
      },{
        id:2,
        url:'https://kanekikeh.online/kechengzhanyan/picture/zhanyan.png'
      }],
      wencui_data : result,
      navbarHeight
    })
    wx.hideLoading()
  },
  // cardSwiper
  cardSwiper(e) {
    this.setData({
      cardCur: e.detail.current
    })
  },
  Back(){
    wx.navigateBack({
      delta: 1
    })
  },
  UserChoice(e){
    const id = e.currentTarget.dataset.id
    const wencui_data = JSON.stringify(this.data.wencui_data[id])
    wx.navigateTo({
      url: '/pages/wencui/shige/index?wencui_data=' + wencui_data,
    })
  }
})